<?php
/**
 * Created by PhpStorm.
 * User: cuipengyu
 * Date: 2018-12-28
 * Time: 15:39
 */

namespace com;

class GeoCityUtils
{

    public static function getGeoInfo($ip){
        require_once(ROOT_PATH."/extend/com/geoipcity.inc.php");
        $gi = geoip_open_VMWO(ROOT_PATH.'/extend/com/GeoLiteCity.dat', VMWO_GEOIP_STANDARD);
        $record = geoip_record_by_addr_VMWO($gi, $ip);
        $record = json_decode(json_encode($record),true);
        return $record;
    }


}

